<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>评价详情</title>
  <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
  <style>
    :root {
      --primary-color: #4a6bdf;
      --secondary-color: #6c757d;
      --success-color: #28a745;
      --light-color: #f8f9fa;
      --dark-color: #343a40;
      --border-radius: 12px;
      --box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      font-family: 'Noto Sans SC', sans-serif;
      background-color: #f5f7fa;
      color: #333;
      line-height: 1.6;
    }

    .container {
      max-width: 800px;
      margin: 40px auto;
      padding: 0 20px;
    }

    .evaluation-card {
      background: white;
      border-radius: var(--border-radius);
      box-shadow: var(--box-shadow);
      overflow: hidden;
      transition: transform 0.3s ease;
    }

    .evaluation-card:hover {
      transform: translateY(-5px);
    }

    .evaluation-header {
      background: linear-gradient(135deg, var(--primary-color), #6a11cb);
      color: white;
      padding: 25px;
      position: relative;
    }

    .evaluation-title {
      font-size: 24px;
      font-weight: 700;
      margin-bottom: 10px;
    }

    .evaluation-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 15px;
      font-size: 14px;
      opacity: 0.9;
    }

    .evaluation-meta-item {
      display: flex;
      align-items: center;
    }

    .evaluation-meta-item i {
      margin-right: 5px;
      font-size: 16px;
    }

    .evaluation-body {
      padding: 25px;
    }

    .evaluation-content {
      background: var(--light-color);
      padding: 20px;
      border-radius: 8px;
      margin-bottom: 25px;
      position: relative;
    }

    .evaluation-content:before {
      content: "";
      font-family: serif;
      font-size: 60px;
      color: rgba(0, 0, 0, 0.05);
      position: absolute;
      top: 10px;
      left: 10px;
    }

    .evaluation-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 15px 25px;
      border-top: 1px solid #eee;
    }

    .evaluation-id {
      font-size: 14px;
      color: var(--secondary-color);
    }

    .btn {
      display: inline-block;
      padding: 10px 20px;
      border-radius: 50px;
      text-decoration: none;
      font-weight: 500;
      transition: all 0.3s ease;
      border: none;
      cursor: pointer;
    }

    .btn-back {
      background-color: var(--primary-color);
      color: white;
    }

    .btn-back:hover {
      background-color: #3a56c4;
      transform: translateX(-3px);
    }

    .rating {
      display: inline-flex;
      margin-top: 15px;
    }

    .star {
      color: #ffc107;
      font-size: 20px;
      margin-right: 3px;
    }

    @media (max-width: 768px) {
      .container {
        margin: 20px auto;
      }

      .evaluation-header {
        padding: 20px;
      }

      .evaluation-title {
        font-size: 20px;
      }
    }
  </style>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
</head>
<body>
<div class="container">
  <div class="evaluation-card">
    <div class="evaluation-header">
      <h1 class="evaluation-title">维修评价详情</h1>
      <div class="evaluation-meta">
        <span class="evaluation-meta-item">
          <i class="fas fa-tools"></i> <%=request.getParameter("description")%>
        </span>
        <span class="evaluation-meta-item">
          <i class="fas fa-user"></i> <%=request.getParameter("nickname")%>
        </span>
        <span class="evaluation-meta-item">
          <i class="far fa-calendar-alt"></i> <%=request.getParameter("evaluationTime")%>
        </span>
        <span class="evaluation-meta-item">
          <i class="fas fa-user-cog"></i> 李师傅
        </span>
      </div>
    </div>

    <div class="evaluation-body">
      <div class="evaluation-content">
        <p><%=request.getParameter("content")%></p>
        <% 
        String tags = request.getParameter("evaluationTags");
        if(tags != null && !tags.isEmpty()) { 
        %>
        <div class="tag-container" style="margin-top: 15px;">
          <% for(String tag : tags.split(",")) { %>
            <span class="tag"><%=tag%></span>
          <% } %>
        </div>
        <% } %>
      </div>

      <div class="rating">
        <% 
  int rating = 0;
  try {
      rating = Integer.parseInt(request.getParameter("rating"));
  } catch(Exception e) {}
  for(int i=0; i<5; i++) { 
  %>
  <span class="star"><i class="fas fa-star<%=i<rating?"":"-o"%>"></i></span>
  <% } %>
      </div>
    </div>

    <div class="evaluation-footer">
      <span class="evaluation-id">评价ID: <%=request.getParameter("id")%></span>
      <a href="repair_evaluationList.jsp" class="btn btn-back">
        <i class="fas fa-arrow-left"></i> 返回评价列表
      </a>
    </div>
  </div>
</div>
</body>
</html>